package com.kh.pajx.sop.view.action;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * 程序主入口控制器
 * @author:	azzcsimp
 * @Createdate:	2014年6月19日 下午4:47:02
 */
@Controller
@Scope("prototype")
public class HomeAction extends ActionSupport {

	private static final long serialVersionUID = -8082317478641316472L;


	public String index(){
		/*(RequestUtils.getIpAddr(ServletActionContext.getRequest()));
		(RequestUtils.getIpAddr((HttpServletRequest)(ActionContext.getContext().get(StrutsStatics.HTTP_REQUEST))));
		(ServletActionContext.getRequest());
		((HttpServletRequest)(ActionContext.getContext().get(StrutsStatics.HTTP_REQUEST)));*/
		
		// 根据登入用户获取菜单信息
		
	/*	// 准备显示信息
		Runtime runtime = Runtime.getRuntime();
		// JVM虚拟机空闲内存大小
		long freeMemoery = runtime.freeMemory();
		// JVM虚拟机内存总量
		long totalMemory = runtime.totalMemory();
		// JVM虚拟机已用内存
		long usedMemory = totalMemory - freeMemoery;
		// JVM虚拟机最大内存
		long maxMemory = runtime.maxMemory();
		// JVM虚拟机剩余内存
		long useableMemory = maxMemory - totalMemory + freeMemoery;
		
		ActionContext.getContext().put("freeMemoery", freeMemoery);
		ActionContext.getContext().put("totalMemory", totalMemory);
		ActionContext.getContext().put("usedMemory", usedMemory);
		ActionContext.getContext().put("maxMemory", maxMemory);
		ActionContext.getContext().put("useableMemory", useableMemory);*/
		
		return "index";
	}
	
	public String readme(){
		return "readme";
	}
	
	
	public String about(){
		return "about";
	}
	}